﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Web.Mvc;
using FingerPrint.WebUI.Models;
using FingerPrint.WebUI.ViewModels;

namespace FingerPrint.WebUI.Models
{
    // Define the schema and table to connect
    [Table("SalesOrder", Schema = "Sales")]
    public class SalesOrderModel
    {
        //[HiddenInput(DisplayValue = false)]
        public int SalesOrderID { get; set; }

        [DisplayName("SalesOrder Number")]
        [Required(ErrorMessage = "Please enter a SalesOrderNumber")]
        public string SalesOrderNumber { get; set; }

        [DisplayName("Received Date")]
        [DataType(DataType.Date)]
        public DateTime? ReceivedDate { get; set; }

        [DisplayName("Received By")]
        public int? EmployeeID { get; set; }    // the int? means it is a nullable type

        [DisplayName("Customer ID")]
        public int? CustomerID { get; set; }

        [DisplayName("Contact ID")]
        public int? ContactID { get; set; }

        [DisplayName("Deadline")]
        [DataType(DataType.Date)]
        public DateTime? Deadline { get; set; }

        [DisplayName("Invoice Number")]
        public string InvoiceNumber { get; set; }

        [Required(ErrorMessage = "Plesae provide remark")]
        [DataType(DataType.MultilineText)]
        [DisplayName("Remark")]
        public string Remark { get; set; }

        [DisplayName("Modified Date")]
        public DateTime? ModifiedDate { get; set; }

        [DisplayName("Status")]
        public string Status { get; set; }



        // For reference to the object class
        public virtual Employee Employee { get; set; }
        public virtual Customer Customer { get; set; }

        //-------------------------------------------------------------

        public IEnumerable<SalesOrder> SalesOrders { get; set; }

    }

}
